<?php
/**
 *
 * @authors  Ysg (y.shi.guo@gmail.com)
 * @website  http://ysg.bonza.cn
 * @date     2017-07-24 11:43:02
 */

header("Content-type:text/html;charset:utf8;");

function digui($path){
	$d = dir($path);

	echo "Handle: " . $d->handle . "<br>";
	echo "Path: " . $d->path . "<br>";

	while (($file = $d->read()) !== false){
		if (is_dir($file)) {
			echo "<hr />";
			if ($file == '.' || $file == '..') {
				echo "目录为: " . $file . "<br>";
			}else{
				digui($file);
				// echo "string";die;
			}
			echo "<hr />";
		}else{
			echo "文件为: " . $file . "<br>";
		}
	}
	$d->close();
}

// digui(getcwd());

/*echo DIRECTORY_SEPARATOR;
echo "<br/>";
echo PATH_SEPARATOR;*/

// echo getcwd();

/*if (is_dir(getcwd())) {
	$d = opendir(getcwd());
	while (($file = readdir($d)) !== false) {
		echo "文件名或者目录名为：".$file."<br/>";
	}
	closedir($d);
}*/

$dir = scandir('./admin');
// print_r($dir);
foreach ($dir as $key => $value) {
	if (is_dir($value)) {
		echo "目录为：".$value."<br/>";
	}elseif(is_file($value)){
		echo "文件为：".$value."<br/>";
	}else{
		echo "其他：".$value."<br/>";
	}
}

// INSERT INTO `users` (`id`, `name`, `age`) VALUES ('3', 'ff', '25')









